home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / misc / dspice0s / indxx.c < prev    next >
C/C++ Source or Header  |  1992-11-21  |  4KB  |  158 lines

  1. /* indxx.f -- translated by f2c (version of 3 February 1990  3:36:42).
  2.    You must link the resulting object file with the libraries:
  3.     -lF77 -lI77 -lm -lc   (in that order)
  4. */
  5.  
  6. #include "f2c.h"
  7.  
  8. /* Common Block Declarations */
  9.  
  10. struct {
  11.     integer ielmnt, isbckt, nsbckt, iunsat, nunsat, itemps, numtem, isens, 
  12.         nsens, ifour, nfour, ifield, icode, idelim, icolum, insize, 
  13.         junode, lsbkpt, numbkp, iorder, jmnode, iur, iuc, ilc, ilr, 
  14.         numoff, isr, nmoffc, iseq, iseq1, neqn, nodevs, ndiag, iswap, 
  15.         iequa, macins, lvnim1, lx0, lvn, lynl, lyu, lyl, lx1, lx2, lx3, 
  16.         lx4, lx5, lx6, lx7, ld0, ld1, ltd, imynl, imvn, lcvn, nsnod, 
  17.         nsmat, nsval, icnod, icmat, icval, loutpt, lpol, lzer, irswpf, 
  18.         irswpr, icswpf, icswpr, irpt, jcpt, irowno, jcolno, nttbr, nttar, 
  19.         lvntmp;
  20. } tabinf_;
  21.  
  22. #define tabinf_1 tabinf_
  23.  
  24. struct {
  25.     integer locate[50], jelcnt[50], nunods, ncnods, numnod, nstop, nut, nlt, 
  26.         nxtrm, ndist, ntlin, ibr, numvs, numalt, numcyc;
  27. } cirdat_;
  28.  
  29. #define cirdat_1 cirdat_
  30.  
  31. struct {
  32.     doublereal value[200000];
  33. } blank_;
  34.  
  35. #define blank_1 blank_
  36.  
  37. /*<       integer function indxx(node1,node2) >*/
  38. integer indxx_(node1, node2)
  39. integer *node1, *node2;
  40. {
  41.     /* System generated locals */
  42.     integer ret_val;
  43.  
  44.     /* Local variables */
  45.     static integer n1, n2;
  46. #define nodplc ((integer *)&blank_1)
  47. #define cvalue ((complex *)&blank_1)
  48.     static integer loc;
  49.  
  50. /*<       implicit double precision (a-h,o-z) >*/
  51.  
  52. /*     this routine maps a (row, column) matrix term specification into */
  53.  
  54. /* the offset from the origin of the matrix storage at which the term is 
  55. */
  56. /* actually located. */
  57.  
  58. /* spice version 2g.6  sccsid=tabinf 3/15/83 */
  59. /*<       common /tabinf/ ielmnt,isbckt,nsbckt,iunsat,nunsat,itemps,numtem, >*/
  60. /*<      1   isens,nsens,ifour,nfour,ifield,icode,idelim,icolum,insize, >*/
  61. /*<      2   junode,lsbkpt,numbkp,iorder,jmnode,iur,iuc,ilc,ilr,numoff,isr, >*/
  62. /*<      3   nmoffc,iseq,iseq1,neqn,nodevs,ndiag,iswap,iequa,macins,lvnim1, >*/
  63. /*<      4   lx0,lvn,lynl,lyu,lyl,lx1,lx2,lx3,lx4,lx5,lx6,lx7,ld0,ld1,ltd, >*/
  64. /*<      5   imynl,imvn,lcvn,nsnod,nsmat,nsval,icnod,icmat,icval, >*/
  65. /*<      6   loutpt,lpol,lzer,irswpf,irswpr,icswpf,icswpr,irpt,jcpt, >*/
  66. /*<      7   irowno,jcolno,nttbr,nttar,lvntmp >*/
  67. /* spice version 2g.6  sccsid=cirdat 3/15/83 */
  68. /*<       common /cirdat/ locate(50),jelcnt(50),nunods,ncnods,numnod,nstop, >*/
  69. /*<      1   nut,nlt,nxtrm,ndist,ntlin,ibr,numvs,numalt,numcyc >*/
  70. /* spice version 2g.6  sccsid=blank 3/15/83 */
  71. /*<       common /blank/ value(200000) >*/
  72. /*<       integer nodplc(64) >*/
  73. /*<       complex cvalue(32) >*/
  74. /*<       equivalence (value(1),nodplc(1),cvalue(1)) >*/
  75.  
  76. /*<       if (node1.eq.1) go to 100 >*/
  77.     if (*node1 == 1) {
  78.     goto L100;
  79.     }
  80. /*<       if (node2.eq.1) go to 100 >*/
  81.     if (*node2 == 1) {
  82.     goto L100;
  83.     }
  84.  
  85. /*<       n1=nodplc(irswpr+node1) >*/
  86.     n1 = nodplc[tabinf_1.irswpr + *node1 - 1];
  87. /*<       n2=nodplc(icswpr+node2) >*/
  88.     n2 = nodplc[tabinf_1.icswpr + *node2 - 1];
  89. /*<       if (n1-n2) 10,10,30 >*/
  90.     if (n1 - n2 <= 0) {
  91.     goto L10;
  92.     } else {
  93.     goto L30;
  94.     }
  95.  
  96. /*     search col n2 */
  97.  
  98. /*<    10 loc=n2 >*/
  99. L10:
  100.     loc = n2;
  101. /*<    15 loc=nodplc(irpt+loc) >*/
  102. L15:
  103.     loc = nodplc[tabinf_1.irpt + loc - 1];
  104. /*<       if (loc.eq.0) go to 100 >*/
  105.     if (loc == 0) {
  106.     goto L100;
  107.     }
  108. /*<       if (nodplc(irowno+loc)-n1) 15,20,15 >*/
  109.     if (nodplc[tabinf_1.irowno + loc - 1] - n1 != 0) {
  110.     goto L15;
  111.     } else {
  112.     goto L20;
  113.     }
  114. /*<    20 indxx=loc >*/
  115. L20:
  116.     ret_val = loc;
  117. /*<       return >*/
  118.     return ret_val;
  119.  
  120. /*     search row n1 */
  121.  
  122. /*<    30 loc=n1 >*/
  123. L30:
  124.     loc = n1;
  125. /*<    35 loc=nodplc(jcpt+loc) >*/
  126. L35:
  127.     loc = nodplc[tabinf_1.jcpt + loc - 1];
  128. /*<       if (loc.eq.0) go to 100 >*/
  129.     if (loc == 0) {
  130.     goto L100;
  131.     }
  132. /*<       if (nodplc(jcolno+loc)-n2) 35,40,35 >*/
  133.     if (nodplc[tabinf_1.jcolno + loc - 1] - n2 != 0) {
  134.     goto L35;
  135.     } else {
  136.     goto L40;
  137.     }
  138. /*<    40 indxx=loc >*/
  139. L40:
  140.     ret_val = loc;
  141. /*<       return >*/
  142.     return ret_val;
  143.  
  144. /*     unused location */
  145.  
  146. /*<   100 indxx=1 >*/
  147. L100:
  148.     ret_val = 1;
  149. /*<       return >*/
  150.     return ret_val;
  151. /*<       end >*/
  152. } /* indxx_ */
  153.  
  154. #undef cvalue
  155. #undef nodplc
  156.  
  157.  
  158.